/*
 * Copyright (c) gitee.com/jiandong001.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */

import HashMap from '@ohos.util.HashMap';
import { ReadableMap } from '../bridge/ReadableMap';
import { ReadableArray } from '../bridge/ReadableArray';

//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//


export class ReactStylesDiffMap {
    mBackingMap: ReadableMap;
//
    public constructor(props: ReadableMap) {
        this.mBackingMap = props;
    }

    public toMap(): HashMap<string, any>  {
        // return this.mBackingMap.toHashMap();
        return this.mBackingMap;
    }

    public hasKey(name: string): boolean {
        return this.mBackingMap.hasKey(name);
    }

    public isNull(name: string): boolean {
        return this.mBackingMap.isNull(name);
    }

    public getBoolean(name: string, restoreNullToDefaultValue: boolean): boolean {
        return this.mBackingMap.isNull(name) ? restoreNullToDefaultValue : this.mBackingMap.getBoolean(name);
    }

    public getNumber(name: string, restoreNullToDefaultValue: number): number {
      return this.mBackingMap.isNull(name) ? restoreNullToDefaultValue : this.mBackingMap.getNumber(name);
    }

//    public getFloat(name: string, restoreNullToDefaultValue: number): number {
//      return this.mBackingMap.isNull(name) ? restoreNullToDefaultValue : this.mBackingMap.getDouble(name);
//    }
//
//    public getInt(name: string, restoreNullToDefaultValue: number): number {
//      return this.mBackingMap.isNull(name) ? restoreNullToDefaultValue : this.mBackingMap.getInt(name);
//    }
//
//    public getDouble(name: string, restoreNullToDefaultValue: number): number {
//        return this.mBackingMap.isNull(name) ? restoreNullToDefaultValue : this.mBackingMap.getDouble(name);
//    }

    public getString(name: string): string | null {
        return this.mBackingMap.getString(name);
    }

    public getArray(key: string): ReadableArray | null {
        return this.mBackingMap.getArray(key);
    }

    public getMap(key: string): ReadableMap | null {
        return this.mBackingMap.getMap(key);
    }

//    public  Dynamic getDynamic(key: string) | null {
//        return this.mBackingMap.getDynamic(key);
//    }

    public toString(): string {
        return "{ " + this.toString() + ": " + this.mBackingMap.toString() + " }";
    }
}
